//
//  BHGlobleUtil.h
//  Behing
//
//  Created by Lj on 2017/9/27.
//  Copyright © 2017年 lj. All rights reserved.
//

#ifdef DEBUG
#define DLog(...) NSLog(__VA_ARGS__)
#define DMethod() NSLog(@"%s", __func__)
#else
#define DLog(...)
#define DMethod()
#endif

#define WeakObj(o) autoreleasepool{} __weak typeof(o) o##Weak = o;

// 计算字符串size
#define BH_TEXTSIZE(text, font) [text length] > 0 ? [text sizeWithAttributes:@{NSFontAttributeName:font}] : CGSizeZero;
#define BH_MULTILINE_TEXTSIZE(text, font, maxSize, mode) [text length] > 0 ? [text boundingRectWithSize:maxSize options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:font} context:nil].size : CGSizeZero;

//机型
#define kDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

//尺寸
#define App_Frame_Height    [[UIScreen mainScreen] bounds].size.height
#define App_Frame_Width     [[UIScreen mainScreen] bounds].size.width

#define rectStatus  [[UIApplication sharedApplication] statusBarFrame]
#define kStatusHeight           (rectStatus.size.height)
#define kTopBarHeight           (44.f)
#define kNavbarAndStatusBar     (kStatusHeight + kTopBarHeight)
#define kBottomBarHeight        (kDevice_Is_iPhoneX ? 83.f : 49.f)
#define kBarHeight              (kDevice_Is_iPhoneX ? 34.f : 0.f)

#define SizeScale ((App_Frame_Width > 320.00) ? App_Frame_Width/375.00 : 1)


#pragma mark - 字体大小
#define BHFont_Size_7 [UIFont systemFontOfSize:SizeScale *7.0]

#define BHFont_Size_9 [UIFont systemFontOfSize:SizeScale *9.0]

#define BHFont_Size_10 [UIFont systemFontOfSize:SizeScale *10.0]

#define BHFont_Size_11 [UIFont systemFontOfSize:SizeScale *11.0]

#define BHFont_Size_12 [UIFont systemFontOfSize:SizeScale *12.0]

#define BHFont_Size_13 [UIFont systemFontOfSize:SizeScale *13.0]

#define BHFont_Size_14 [UIFont systemFontOfSize:SizeScale *14.0]

#define BHFont_Size_15 [UIFont systemFontOfSize:SizeScale *15.0]

#define BHFont_Size_16 [UIFont systemFontOfSize:SizeScale *16.0]

#define BHFont_Size_17 [UIFont systemFontOfSize:SizeScale *17.0]

#define BHFont_Size_18 [UIFont systemFontOfSize:SizeScale *18.0]

#define BHFont_Size_22 [UIFont systemFontOfSize:SizeScale *22.0]

#define BHFont_Size_25 [UIFont systemFontOfSize:SizeScale *25.0]

#pragma mark - 图片高度
//图片高度
#define BHImageHeight (App_Frame_Width - 32)/3
/** 社区单张图片的高度 */
#define BHCommunity_ImageHeight (App_Frame_Width - 30)*3/5

